#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>

#define x first
#define y second
using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
const int N = 1e5 + 10;

int n;
char c;
int main()
{
	cin.tie(0);
	cin >> n >> c;
	// 先求出来底边是第几个数字
	int m = sqrt((n + 1) / 2);
	int tmp = m;
	int cnt = 0;

	for(int i = tmp; i > 0; i --)
	{
		if(cnt){
			int j = 0;
			while(j < cnt) {
				cout << " ";
				j ++;
			}
			for(int k = 0; k < 2 * i - 1; k ++) cout << c; 
		}
		else {
			
			for(int k = 0; k < 2 * i - 1; k ++) cout << c;
		}
		cnt ++;
		puts("");
	}
	// cnt = tmp - 1;
	cnt -= 2;
	for(int i = 2; i <= tmp; i ++)
	{
		int j = 0;
		while(j < cnt) cout << " ", j ++;
		for(int k = 0; k < 2 * i - 1; k ++) cout << c;
		cnt --;
		puts("");
	}
	int rest = n - (2 * m * m - 1);
	cout << rest << endl;
	return 0;
}

/**
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>


#define x first
#define y second
using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
const int N = 1e5 + 10;

int n;
char c;
int main()
{
	cin.tie(0);
	cin >> n >> c;

	int top = floor(sqrt(2.0 * (n + 1))) - 1;
	if(top % 2 == 0) top --;

	int used = (top + 1) * (top + 1) / 2 - 1;
	int times = (top + 1) / 2;
	for(int i = 0; i < times; i ++)
	{
		for(int j = 0; j < i; j ++) cout << " ";
		for(int j = 0; j < top; j ++) cout << c;
		top -= 2;
		cout << endl;
	}
	top += 4;
	for(int i = times - 1; i > 0; i --)
	{
		for(int j = i - 1; j > 0; j --) cout << " ";
		for(int j = 0; j < top; j ++) cout << c;
		top += 2;
		cout << endl;
	}
	
	cout << n - used << endl;
	return 0;
}
/